package com.ruoyi.zsyh.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.zsyh.mapper.ZsyhPartsSalesMapper;
import com.ruoyi.zsyh.domain.ZsyhPartsSales;
import com.ruoyi.zsyh.service.IZsyhPartsSalesService;
import com.ruoyi.common.core.text.Convert;

/**
 * 产品销量统计Service业务层处理
 * 
 * @author yuexl
 * @date 2021-12-29
 */
@Service
public class ZsyhPartsSalesServiceImpl implements IZsyhPartsSalesService 
{
    @Autowired
    private ZsyhPartsSalesMapper zsyhPartsSalesMapper;

    /**
     * 查询产品销量统计
     * 
     * @param id 产品销量统计ID
     * @return 产品销量统计
     */
    @Override
    public ZsyhPartsSales selectZsyhPartsSalesById(String id)
    {
        return zsyhPartsSalesMapper.selectZsyhPartsSalesById(id);
    }

    /**
     * 查询产品销量统计列表
     * 
     * @param zsyhPartsSales 产品销量统计
     * @return 产品销量统计
     */
    @Override
    public List<ZsyhPartsSales> selectZsyhPartsSalesList(ZsyhPartsSales zsyhPartsSales)
    {
        return zsyhPartsSalesMapper.selectZsyhPartsSalesList(zsyhPartsSales);
    }

    /**
     * 新增产品销量统计
     * 
     * @param zsyhPartsSales 产品销量统计
     * @return 结果
     */
    @Override
    public int insertZsyhPartsSales(ZsyhPartsSales zsyhPartsSales)
    {
        return zsyhPartsSalesMapper.insertZsyhPartsSales(zsyhPartsSales);
    }

    /**
     * 修改产品销量统计
     * 
     * @param zsyhPartsSales 产品销量统计
     * @return 结果
     */
    @Override
    public int updateZsyhPartsSales(ZsyhPartsSales zsyhPartsSales)
    {
        return zsyhPartsSalesMapper.updateZsyhPartsSales(zsyhPartsSales);
    }

    /**
     * 删除产品销量统计对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteZsyhPartsSalesByIds(String ids)
    {
        return zsyhPartsSalesMapper.deleteZsyhPartsSalesByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除产品销量统计信息
     * 
     * @param id 产品销量统计ID
     * @return 结果
     */
    @Override
    public int deleteZsyhPartsSalesById(String id)
    {
        return zsyhPartsSalesMapper.deleteZsyhPartsSalesById(id);
    }

    public List<ZsyhPartsSales> getPartsSalesList(Integer year, Integer month, String ids){
        return zsyhPartsSalesMapper.getPartsSalesList(year, month, Convert.toStrArray(ids));
    }

    public int insertZsyhPartsSalesBatch(List<ZsyhPartsSales> list){
        return zsyhPartsSalesMapper.insertZsyhPartsSalesBatch(list);
    }

    public int updateZsyhPartsSalesBatch(List<ZsyhPartsSales> list){
        return zsyhPartsSalesMapper.updateZsyhPartsSalesBatch(list);
    }
}
